﻿<ChartControls:ChartBase x:Class="EpiDashboard.Controls.Charting.PieChart"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:EpiDashboard="clr-namespace:EpiDashboard;assembly=EpiDashboard"
             xmlns:Controls="clr-namespace:EpiDashboard.Controls;assembly=EpiDashboard"
             xmlns:ChartControls="clr-namespace:EpiDashboard.Controls.Charting"
             xmlns:charting="clr-namespace:ComponentArt.Win.DataVisualization.Charting;assembly=ComponentArt.Win.DataVisualization.Charting"             
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid x:Name="gridChartLayoutRoot">

        <!--<Grid.ContextMenu>
            <ContextMenu x:Name="gadgetContextMenu">
                <MenuItem x:Name="mnuSave" Header="Save chart as image..." Click="mnuSave_Click" />
                <MenuItem x:Name="mnuCopyImage" Header="Copy chart image to clipboard" Click="mnuCopyImage_Click" />
                <MenuItem x:Name="mnuCopyFullData" Header="Copy all data to clipboard" Click="mnuCopyFullData_Click" />
            </ContextMenu>
        </Grid.ContextMenu>-->

        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Center">
            <TextBlock x:Name="tblockChartTitle" HorizontalAlignment="Center" TextAlignment="Center" FontSize="22" FontWeight="Bold" Margin="0, 2, 0, 0" />
            <TextBlock x:Name="tblockSubTitle" HorizontalAlignment="Center" TextAlignment="Center" FontSize="18" FontWeight="Bold" Margin="0, 24, 0, 0" />
            <TextBlock x:Name="tblockStrataTitle" HorizontalAlignment="Center" FontSize="14" FontWeight="Bold" Margin="0, 20, 0, 0" />
        </StackPanel>

        <Canvas x:Name="yAxisLabelCanvas" Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="25" Height="Auto" Margin="6, 0, -20, 0" >
            <TextBlock x:Name="tblockYAxisLabel" FontWeight="DemiBold" Canvas.Bottom="0" Canvas.Left="0" TextAlignment="Center" Margin="0,0,0,-20" Text="Count" Visibility="Collapsed" >                    
                                <TextBlock.RenderTransform>
                                    <TransformGroup>                                
                                        <RotateTransform x:Name="rotate" Angle="270" />
                                    </TransformGroup>
                                </TextBlock.RenderTransform>
            </TextBlock>
        </Canvas>

        <TextBlock x:Name="tblockXAxisLabel" FontWeight="DemiBold" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0, 0, 0, 6" Visibility="Collapsed" />

        <charting:PieChart Margin="1" x:Name="xyChart" XPath="S" Grid.Row="1" Grid.Column="1" DataStructureCreated="xyChart_DataStructureCreated" AnimationCompleted="xyChart_AnimationCompleted" Background="White">
            <charting:PieSeries x:Name="series0" Id="S0" YPath="Y" ShowPointAnnotations="True">
            </charting:PieSeries>
        </charting:PieChart>
    </Grid>
</ChartControls:ChartBase>
